import { useNavigate } from 'react-router-dom';
import { NavBar } from 'antd-mobile';

interface NavBarProps {
  title?: string;
  right?: React.ReactNode;
  onBack?: () => void;
}

function Index({ title = '' }: NavBarProps) {
  const nav = useNavigate();

  const handleBack = () => {
   
      nav(-1);
    
  };

  return (
    <div style={{ width: '100vw', minHeight: '100vh', background: '#fff' }}>
      {/* 顶部导航栏 */}
      <NavBar
        onBack={handleBack}
       
      >
        {title}
      </NavBar>

  
    </div>
  );
}

export default Index;
